<template>
  <div>
    <van-nav-bar title="周报详情" left-arrow @click-left="onClickLeft" />
    <van-cell-group>
      <van-cell title="提交日期：" :value="zp_time" />
    </van-cell-group>
    <van-cell-group>
      <van-cell title="班级：" :value="zp_class" />
    </van-cell-group>
    <p style="paddingLeft: 4%">本周知识点：</p>
    <div class="detailed_content">
        {{zp_content}}
    </div>
    <p style="paddingLeft: 4%">任课老师评价：</p>
    
    <div>
        <van-field name="rate" label="评分">
  <template #input>
    <van-rate v-model="rate" readonly />
  </template>
</van-field>
    </div>
  </div>
</template>
<script>
export default {
  name: "show_weekly",
  data() {
    return {
      zp_time:'',
      rate: this.zp_rate,
      zp_content:'',
      zp_class:'',
    };
  },
  mounted() {
    let index = this.$route.query.index;
    // console.log(index);
    this.userId = localStorage.getItem("userId");
    this.axios({
      url:"http://localhost:3000/weekly_inquiry",
      method:"post",
      data:{
          userID:this.userId
      }
    }).then((res)=>{
      console.log(res.data[index])
    this.zp_time=res.data[index].zp_time
    this.zp_content=res.data[index].zp_content
    this.zp_class=res.data[index].zp_class
    this.rate=res.data[index].zp_rate

    //   this.user_name=res.data[0].user_name
    })
  },
  methods: {
    onClickLeft() {
      this.$router.go(-1);
    },
  },
};
</script>
<style scoped>
/deep/input {
  text-align: right;
}
/deep/.van-icon-arrow-left {
  color: black;
}
.detailed_content{
    width: 90%;
    margin: 0px auto;
    /* border: 1px solid rgb(19, 18, 18);    */
    height: 200px;
    overflow: hidden;
}
</style>